#include <iostream>
#include <vector>
#include <algorithm>


template <typename T> 
void read_array(std::vector <T>* input_array) {
    int n;
    std::cin >> n;
    input_array->reserve(n);
    for (int i = 0; i < n; ++i) {
        T number; std::cin >> number;
        input_array->push_back(number);
    }
}

template <typename InIt>
InIt my_partition(InIt first, InIt last, int x) {
    while (first != last) {
        while (*first < x) {
            ++first;
            if (first==last) return first;
        }
        do {
            --last;
            if (first==last) return first;
        } while (*last > x);
        std::swap(*first, *last);
        ++first;
      }
      return first;
} 


template <typename T>
void quick_sort(T first, T last) {
    if (std::distance(first, last) <= 1)
        return;
    T middle = std::next(first,((long long) rand() * (long long)rand()) % std::distance(first, last));
    middle = my_partition(first, last, *middle);
    if (!is_sorted(first, middle)) 
        quick_sort(first, middle);
    if (!is_sorted(middle, last))
        quick_sort(middle, last);
}


int main() {
    std::vector <int> input_array;
    read_array(&input_array);
    quick_sort(input_array.begin(), input_array.end());
    for (auto el : input_array) {
        std::cout << el << " ";
    }
}
